var add_form_panels = Ext.create("Ext.form.Panel", {
	url: "",
	buttonAlign: "center",
	bodyStyle: "padding: 10px;",
	defaultType: "textfield",
	id: "formMain",
	width: 450,
	items: [{
			fieldLabel: "模型名称",
			emptyText: "请填写模型名称",
			name: "",
			width: "100%"
		},
		{
			fieldLabel: "模型key",
			emptyText: "请填写模型key",
			name: "",
			width: "100%"
		},
		{
			xtype: "combo",
			fieldLabel: "业务类别",
			emptyText: "请选择业务类别",
			name: "",
			//allowBlank: false,//是否允许为空
			editable: false,//是否可编辑
			lazyInit: false,//延时初始化下拉列表，默认为true
			triggerAction: 'all',
			valueField: 'value',
			width: "100%",
			store: new Ext.data.ArrayStore({
				fields: ['value', 'text'],
				data: [
						["1", "123"],
						["0", "456"]
				],
			}),
		},
		{
			fieldLabel: "模型版本",
			emptyText: "请填写模型版本",
			name: "",
			width: "100%"
		},
		{
			fieldLabel: "多租户标识",
			emptyText: "填写多租户标识",
			name: "",
			width: "100%"
		},
		{
			xtype: 'textarea',
			emptyText: "请填写模型描述",
			labelWidth: 100,
			fieldLabel: '描述',
			width: 400
		}
	],
	buttons: [{
		text: "保存",
		formBind: true, // only enabled once the form is valid
		disabled: true,
		handler: function() {
			var form = this.up("form").getForm();
			if (form.isValid()) {
				form.submit({
					waitMsg: "保存中...",
					success: function(form, action) {
						Ext.Msg.alert("提示", action.result.result);
						add_form_panel_wins.close();
						dataStore2.load();
					},
					failure: function(form, action) {
						Ext.Msg.alert("提示", "操作失败！");
					}
				});
			}
		}
	}]
});

var add_form_panel_wins = Ext.create("Ext.Window", {
	title: "新增工作流模型",
	closeAction: "hide",
	items: add_form_panels,
});

function myAdd() {
	add_form_panels.getForm().reset();
	add_form_panel_wins.show();
	add_form_panels.getForm().isValid();
}
